<!-- Begin Content -->
<div class="row" ng-controller="MyOrdersController">
    <div class="profile-body margin-bottom-20">
        <div class="headline">
            <h2>我的订单</h2>
        </div>

        <!--Table Bordered-->
        <div>
            <form action="#" id="sky-form" class="sky-form form-inline" novalidate="novalidate">
                <div class="row">
                    <daterange-search label="订单范围" btn-text="查看历史订单" on-search="rangSearch"></daterange-search>
                    <div class="form-group">
                        <label>搜索条目：</label>
                        <select class="form-control" ng-model="queryPara.searchKeyName" ng-options="searchKeyItem.key as searchKeyItem.text for searchKeyItem in searchKeyItems"></select>
                        <input type="text" class="form-control" ng-model="queryPara[queryPara.searchKeyName]" />
                        <a href="javascript:void(0)" ng-click="searchOrder()" class="btn-u">查找订单</a>
                    </div>
                </div>
                <div class="row" style="margin-top:15px;">
                    <div class="form-group">
                        <label class="pull-left" style="margin-top:5px;">订单状态：</label>
                        <div class="inline-group pull-left">
                            <label class="radio" style="margin-right: 10px; padding-left: 10px; ">
                                <a href="javascript:void(0)" ng-click="changeQueryStaus('Shipped')" style="font-size:12px">
                                    <input type="radio" ng-model="queryPara.orderStatus" value="Shipped" /><i class="rounded-x"></i>已出库
                                </a>
                            </label>
                            <label class="radio" style="margin-right:10px;padding-left:10px;">
                                <a href="javascript:void(0)" ng-click="changeQueryStaus('PartialShipped')" style="font-size:12px">
                                    <input type="radio" ng-model="queryPara.orderStatus" value="PartialShipped" /><i class="rounded-x"></i>部分出库
                                </a>
                            </label>
                            <label class="radio" style="margin-right:10px;padding-left:10px;">
                                <a href="javascript:void(0)" ng-click="changeQueryStaus('Unpaid')" style="font-size:12px">
                                    <input type="radio" ng-model="queryPara.orderStatus" value="Unpaid" /><i class="rounded-x"></i>待支付
                                </a>
                            </label>
                            <label class="radio" style="margin-right:10px;padding-left:10px;">
                                <a href="javascript:void(0)" ng-click="changeQueryStaus('Processing')" style="font-size:12px">
                                    <input type="radio" ng-model="queryPara.orderStatus" value="Processing" /><i class="rounded-x"></i>处理中
                                </a>
                            </label>
                            <label class="radio" style="margin-right:10px;padding-left:10px;">
                                <a href="javascript:void(0)" ng-click="changeQueryStaus('Void')" style="font-size:12px">
                                    <input type="radio" ng-model="queryPara.orderStatus" value="Void" /><i class="rounded-x"></i>已取消
                                </a>
                            </label>

                            <label class="radio" style="margin-right:10px;padding-left:10px;">
                                <a href="javascript:void(0)" ng-click="changeQueryStaus('Paid')" style="font-size:12px">
                                    <input type="radio" ng-model="queryPara.orderStatus" value="Paid" /><i class="rounded-x"></i>已支付
                                </a>
                            </label>
                            <label class="radio" style="margin-right:10px;padding-left:10px;">
                                <a href="javascript:void(0)" ng-click="changeQueryStaus('Arrears')" style="font-size:12px">
                                    <input type="radio" ng-model="queryPara.orderStatus" value="Arrears" /><i class="rounded-x"></i>运费不足
                                </a>
                            </label>
                            <label class="radio" style="margin-right:10px;padding-left:10px;">
                                <a href="javascript:void(0)" ng-click="changeQueryStaus('Arrived')" style="font-size:12px">
                                    <input type="radio" ng-model="queryPara.orderStatus" value="Arrived" /><i class="rounded-x"></i>已送达
                                </a>
                            </label>
                            <label class="radio" style="margin-right:10px;padding-left:10px;">
                                <a href="javascript:void(0)" ng-click="changeQueryStaus()" style="font-size:12px">
                                    <input type="radio" ng-model="queryPara.orderStatus" value="" /><i class="rounded-x"></i>所有状态
                                </a>
                            </label>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </form>

            <div class="table-search-v1">
                <div class="table-responsive">
                    <table class="table table-hover table-bordered" style="margin-bottom:0px">
                        <thead>
                            <tr>
                                <th style="max-width:10px">#</th>
                                <th style="min-width:220px;max-width:220px;width:220px;">订单编号</th>
                                <th style="width:150px">创建日期</th>
                                <th class="hidden-sm" style="max-width:200px;">订单说明</th>
                                <th style="width:120px">渠道</th>
                                <th style="min-width:100px">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-repeat="rowItem in orderListData">
                                <td>{{rowItem.rownumber}}</td>
                                <td class="td-width">
                                    <small>
                                        <span class="label label-success" ng-if="rowItem.orderStatus==='Shipped'">已出库</span>
                                        <span class="label label-warning" ng-if="rowItem.orderStatus==='Unpaid'">待支付</span>
                                        <span class="label label-info" ng-if="rowItem.orderStatus==='Processing'">处理中</span>
                                        <span class="label label-info" ng-if="rowItem.orderStatus==='Void'">已取消</span>
                                        <span class="label label-success" ng-if="rowItem.orderStatus==='Paid'">已支付</span>
                                        <span class="label label-danger" ng-if="rowItem.orderStatus==='Arrears'">运费不足</span>
                                        <span class="label label-success" ng-if="rowItem.orderStatus==='Arrived'">已送达</span>
                                        <span class="label label-success" ng-if="rowItem.orderStatus==='PartialShipped'">部分出库</span>                                        
                                    </small>
                                    <small>
                                        <a href="javascript:void(0)" ng-click="redirectToDetail(rowItem);"><u>{{rowItem.orderNumber}}</u></a>
                                    </small>
                                    <small ng-if="!!rowItem.isFastOrder" title="极速原单">
                                         <i class="fa fa-bolt" aria-hidden="true" style="color:#ff6a00;font-size:16px;"></i>
                                    </small>
                                </td>
                                <td><small>{{rowItem.orderDate|date:'MM/dd/yyyy HH:mm:ss'}}</small></td>
                                <td class="td-width hidden-sm" style="padding:0px">
                                    <ul class="list-unstyled" style="max-width:200px;overflow:hidden;">
                                        <li ng-repeat="orderDetailItem in rowItem.orderItems" title="{{orderDetailItem.description}} x {{orderDetailItem.quantity}}">
                                            <span class="label label-light">
                                                <i class="fa fa-gift"></i>
                                                <!--{{orderDetailItem.itemBrand}}|
                                                {{orderDetailItem.description}}|
                                                {{orderDetailItem.quantity}}|
                                                {{orderDetailItem.unitprice|currency}}-->
                                                {{orderDetailItem.description}} x {{orderDetailItem.quantity}}
                                            </span>
                                        </li>
                                    </ul>
                                </td>
                                <td><small ng-repeat="orderDetailItemShipChannelItem in allShipChannels" ng-if="orderDetailItemShipChannelItem.shipServiceId===rowItem.shipServiceId">{{orderDetailItemShipChannelItem.shipServiceName}}</small></td>
                                <td>
                                    <div class="btn-group" style="margin-top:5px;">
                                        <ul class="list-inline" style="min-width:100px;font-size:15px;">
                                            <li ng-click="payOrder(rowItem);">
                                                <a href="javascript:void(0)" ng-if="rowItem.orderStatus==='Unpaid' || rowItem.orderStatus==='Arrears'" title="支付订单" data-original-title="支付订单"><i class="fa fa-credit-card"></i></a>
                                            </li>
                                            <li ng-click="deleteOrder(rowItem.orderNumber)">
                                                <a href="javascript:void(0)" ng-if="!rowItem.isFastOrder&&rowItem.orderStatus!=='Paid'" title="删除订单" data-original-title="删除订单"><i class="fa fa-trash-o"></i></a>
                                                <a href="javascript:void(0)" ng-if="!!rowItem.isFastOrder&&(rowItem.orderStatus!=='Shipped'||rowItem.orderStatus!=='PartialShipped')" title="删除订单" data-original-title="删除订单"><i class="fa fa-trash-o"></i></a>
                                            </li>
                                            <li>
                                                <a href="http://wpa.qq.com/msgrd?v=3&uin=189525378&site=qq&menu=yes" class="tooltips" data-toggle="tooltip" title="联系客服"
                                                    data-original-title="联系客服" target="_blank">
                                                    <i class="fa fa-qq"></i>
                                                </a>
                                            </li>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>

                <div class="row" style="margin-top:20px;">
                    <div class="col-sm-3">
                        <a ui-sref="customer.shippingnoticelist" class="btn-u">
                            <i class="fa fa-shopping-cart"> 提交订单</i>
                        </a>
                        <button type="button" class="btn-u btn-u-default" ng-click="goback()">返回</button>
                    </div>
                    <div class="col-sm-9 text-right">
                        <pagination options="pagedOptions" on-page="onPaged"></pagination>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- End Content -->